﻿<phone:PhoneApplicationPage
    xmlns:local="clr-namespace:VodafoneWP7"
    local:TiltEffect.IsTiltEnabled="True"
    x:Class="VodafoneWP7.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolbox="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True" Loaded="MainPage_Loaded" BackKeyPress="PhoneApplicationPage_BackKeyPress" d:DesignHeight="696" d:DesignWidth="480">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <controls:Pivot Name="PivotControl" Title="{Binding Path=Strings.Title, Source={StaticResource LocalizedStrings }}" SelectedIndex="0" SelectionChanged="PivotControl_SelectionChanged">
           
            <!--Pivot item one-->
            <controls:PivotItem Name="Pivot_SMS" Header="SMS" Margin="10,-10,10,10">
                <!--Double line list with text wrapping-->
                <ScrollViewer  IsTabStop="False">
                    <Grid Name="SMSGrid">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0"/>
                            <RowDefinition Height="0"/>
                            <RowDefinition Height="95" />
                            <RowDefinition Height="25" />
                            <RowDefinition Height="240*" />                            
                            <RowDefinition Height="60" />
                        </Grid.RowDefinitions>
                        
                        <!--ContentPanel - place additional content here-->
                        <local:WrapPanel Grid.Row="2">
                        <TextBlock  Name="Receiver_Label" Text="{Binding Path=Strings.Receiver, Source={StaticResource LocalizedStrings }}"  FontSize="20" TextAlignment="Left" VerticalAlignment="Bottom" Margin="15,0,0,0" />
                        <TextBox Name="SMS_Number_Area" Text="{Binding PhoneNumber}" VerticalAlignment="Top" HorizontalAlignment="Left"  Margin="0,0,0,1" Width="380" >
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="TelephoneNumber"/>
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>
                        <Image Name="Search_Button" MouseLeftButtonDown="Search_Button_MouseLeftButtonDown" Width="48" Height="48" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,12,15,0" />
                        </local:WrapPanel>
                        
                        <TextBlock  Name="Message_Label" Text="{Binding Path=Strings.Message, Source={StaticResource LocalizedStrings }}"  FontSize="20" TextAlignment="Left" VerticalAlignment="Bottom" Grid.Row="3" Margin="15,0,0,0" />

                        <!--<ScrollViewer  Grid.Row="4" IsTabStop="False">-->
                        <TextBox Grid.Row="4" Name="SMS_Message_Area" Text="{Binding Message}" AcceptsReturn="True" TextWrapping="Wrap" Margin="0" VerticalScrollBarVisibility="Auto">
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="Text" />
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>
                        <!--</ScrollViewer>-->

                        
                        
                        <Border Name="Boder1" BorderThickness="3" Padding="6"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="6">
                            <toolbox:GestureService.GestureListener>
                                <toolbox:GestureListener Tap="GestureListener1_Tap" />
                            </toolbox:GestureService.GestureListener>
                            <toolbox:ContextMenuService.ContextMenu>
                                <toolbox:ContextMenu Name="Accounts_Context_Menu">
                                </toolbox:ContextMenu>
                            </toolbox:ContextMenuService.ContextMenu>
                            <Border Name="Boder2" BorderBrush="Silver" BorderThickness="2" Padding="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                                <TextBlock  Name="Account_Area" Text="{Binding Path=Strings.ChooseAnAccount, Source={StaticResource LocalizedStrings }}"  FontSize="30" TextAlignment="Center" VerticalAlignment="Center" Height="40" Width="403" />
                            </Border>
                        </Border>

                        <toolbox:PerformanceProgressBar Name="ToggleProgressBar" Grid.Row="3" Height="30" />
                        <!--<Border BorderBrush="Silver" BorderThickness="1" Grid.ColumnSpan="4" Height="56" HorizontalAlignment="Left" Name="border1" VerticalAlignment="Top" Width="409" Margin="13,0,0,0" />-->
                    </Grid>
                </ScrollViewer>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Name="Pivot_Sent" Header="{Binding Path=Strings.Sent, Source={StaticResource LocalizedStrings }}" Margin="10,-10,10,10">

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="65" />
                        <RowDefinition Height="500*" />
                    </Grid.RowDefinitions>

                    <Border Name="Boder3" BorderThickness="3" Padding="6" Grid.ColumnSpan="5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                        <toolbox:GestureService.GestureListener>
                            <toolbox:GestureListener Tap="GestureListener1_Tap" />
                        </toolbox:GestureService.GestureListener>
                        <toolbox:ContextMenuService.ContextMenu>
                            <toolbox:ContextMenu Name="AccountsChoose_Context_Menu">
                            </toolbox:ContextMenu>
                        </toolbox:ContextMenuService.ContextMenu>
                        <Border Name="Boder4" BorderBrush="Silver" BorderThickness="2" Padding="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                            <TextBlock  Name="AccountChooser_Area" Text="{Binding Path=Strings.ChooseAnAccount, Source={StaticResource LocalizedStrings }}"  FontSize="30" TextAlignment="Center" VerticalAlignment="Center" Height="40" Width="403" />
                        </Border>
                    </Border>

                    <ListBox x:Name="Messages_ListBox" Margin="0,0,0,0" ItemsSource="{Binding MessagesItems}" SelectionMode="Single" Grid.Row="1" SelectionChanged="Messages_ListBox_SelectionChanged">
                        <ListBox.ItemTemplate>                            
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" >
                                    <Ellipse Height="35" Width="35" HorizontalAlignment="Left" Name="ellipse1" Stroke="#FF909090" StrokeThickness="3" VerticalAlignment="Center" Fill="{Binding Delete}" Visibility="{Binding CheckVisibility}" />
                                    <Grid x:Name="MessagesGrid" Margin="0,0,0,0" HorizontalAlignment="Center" Width="{Binding Width}">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="40*" />
                                            <RowDefinition Height="30*" />
                                        </Grid.RowDefinitions>
                                      
                                        <TextBlock Text="{Binding Destination}" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="12,0,0,0" Style="{StaticResource PhoneTextLargeStyle}"/>
                                        <TextBlock Grid.Row="1" Text="{Binding Message}" TextWrapping="Wrap" Margin="20,0,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>

                                        <TextBlock Text="{Binding Date}" TextWrapping="NoWrap" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                    </Grid>
                                </StackPanel>
                            </DataTemplate>
                                
                        </ListBox.ItemTemplate>
                    </ListBox>
                   
                </Grid>
            </controls:PivotItem>

            <controls:PivotItem Name="Pivot_Accounts" Header="{Binding Path=Strings.Accounts, Source={StaticResource LocalizedStrings }}" Margin="10,-10,10,10">
                <!--Triple line list no text wrapping-->
                <ListBox x:Name="Accounts_ListBox" Margin="0,0,-12,0" ItemsSource="{Binding AccountsItems}" SelectionChanged="Accounts_ListBox_SelectionChanged" SelectionMode="Single">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="0,0,0,17">
                                <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Margin="12,0,0,0" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                                <TextBlock Text="{Binding Service}" TextWrapping="NoWrap" Margin="12,-6,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                <TextBlock Text="{Binding Description}" TextWrapping="NoWrap" Margin="12,-6,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PivotItem>

            <controls:PivotItem Name="Pivot_Services" Header="{Binding Path=Strings.Services, Source={StaticResource LocalizedStrings }}" Margin="10,-10,10,10">
                <!--Triple line list no text wrapping-->
                <ListBox x:Name="Services_ListBox" Margin="0,0,-12,0" ItemsSource="{Binding ServicesItems}" SelectionMode="Single">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="0,0,0,17">
                                <Image Source="{Binding ImageUri}" Width="48" Height="48" Margin="12,0,0,0" HorizontalAlignment="Left" />
                                <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Margin="80,-60,0,0"  Width="{Binding Width}" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                                <TextBlock Text="{Binding Description}" TextWrapping="Wrap" Margin="80,-6,0,0"  Width="{Binding Width}" Style="{StaticResource PhoneTextSubtleStyle}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PivotItem>

            <controls:PivotItem Name="AdsPivot_Name" Header="{Binding Path=Strings.OtherProducts, Source={StaticResource LocalizedStrings }}" >
                <Grid>
                    <!--<phone:WebBrowser HorizontalAlignment="Left" Name="webBrowser_History" VerticalAlignment="Top" Height="424" Width="454" Visibility="Collapsed" />-->
                    <ListBox x:Name="Ads_List" Margin="0,0,0,-3" ItemsSource="{Binding AdsItems}" SelectionChanged="Ads_List_SelectionChanged" SelectionMode="Single">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <Image Source="{Binding ImageUri}" Width="60" Height="60" Margin="60,0,0,0" HorizontalAlignment="Left" />
                                    <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Margin="150,-70,0,0" Width="{Binding Width}" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding Description}" TextWrapping="Wrap" Margin="150,-25,0,0" Width="{Binding Width}" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>

                </Grid>

            </controls:PivotItem>
                        
            <controls:PivotItem Name="InfoPivot_Name" Header="{Binding Path=Strings.Credits, Source={StaticResource LocalizedStrings }}" >
                <Grid x:Name="CreditsGrid" Grid.Row="1" Margin="12,0,12,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="10*" />
                        <RowDefinition Height="120" />
                        <RowDefinition Height="60*" />
                        <RowDefinition Height="40" />
                        <RowDefinition Height="80" />

                    </Grid.RowDefinitions>

                    <Image Grid.Row="1" HorizontalAlignment="Left" Width="310" Name="image1Landscape" VerticalAlignment="Center" Source="/VodafoneWP7;component/Images/vst_logo.png"/>

                    <StackPanel Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center"  Name="CreditsPanelLandscape" Width="310">
                        <TextBlock TextAlignment="Center" Margin="0,0,0,10" FontSize="24" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Text="{Binding Path=Strings.Developer, Source={StaticResource LocalizedStrings }}" />
                        <TextBlock TextAlignment="Center" HorizontalAlignment="Center"  Text="Luca Cosmo" VerticalAlignment="Center" FontSize="22" />
                        <TextBlock TextAlignment="Center" HorizontalAlignment="Center"  Text="Francesco Boscariol" VerticalAlignment="Center" FontSize="22" />
                    </StackPanel>

                    <Image Grid.Row="1" HorizontalAlignment="Center" Width="300" Name="image1" VerticalAlignment="Center" Source="/VodafoneWP7;component/Images/vst_logo.png"/>

                    <StackPanel Grid.Row="2" VerticalAlignment="Center" Name="CreditsPanel">
                    <TextBlock TextAlignment="Center" Margin="0,0,0,10" FontSize="24" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="Developers_Area" Text="{Binding Path=Strings.Developer, Source={StaticResource LocalizedStrings }}" />
                    <TextBlock TextAlignment="Center" HorizontalAlignment="Center"  Name="textBlock1" Text="Luca Cosmo" VerticalAlignment="Center" FontSize="22" />
                    <TextBlock TextAlignment="Center" HorizontalAlignment="Center"  Name="textBlock2" Text="Francesco Boscariol" VerticalAlignment="Center" FontSize="22" />
                    </StackPanel>
                    <!--<Button Grid.Row="4" Name="Suggestion_Button" Content="{Binding Path=Strings.Suggestion_Text, Source={StaticResource LocalizedStrings }}" Click="Suggestion_Button_Click" />-->

                    <Button Grid.Row="4" Name="Suggestion_Button" Click="Suggestion_Button_Click" FontSize="16">
                        <Button.Content>
                            <TextBlock TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"
            Text="{Binding Path=Strings.Suggestion_Text, Source={StaticResource LocalizedStrings }}"
            TextWrapping="Wrap" FontSize="16" />
                        </Button.Content>
                    </Button>



                    <TextBlock Grid.Row="3" TextAlignment="Center" FontSize="24" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="Version_Area" Text="{Binding Path=Strings.Version, Source={StaticResource LocalizedStrings }}"  TextWrapping="Wrap" />
                </Grid>

            </controls:PivotItem>

        </controls:Pivot>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" />
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>